package com.example.springboot.controller;


import com.example.springboot.pojo.MyUser;
import com.example.springboot.service.MyUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HelloController {

    @Autowired
    private MyUserService myUserService;

    @RequestMapping("/hello1/{id}")
    public List<MyUser> hello1(@PathVariable("id") Integer id){
        return myUserService.getUserById1(id);
    }

    @RequestMapping("/hello2/{id}")
    public int hello2(@PathVariable("id") Integer id){
        return myUserService.updateUserBuId(id);
    }
    @RequestMapping("/hello3/{id}")
    public int hello3(@PathVariable("id") Integer id){
        return myUserService.updateUserBuId2(id);
    }
}
